@echo off
set /p fileName=Enter DAE fileName:

md .\convert\%fileName%
@echo ********************* Step 1 of 2 [DAE--GLTF] *********************
.\COLLADA2GLTF-v2.1.5\COLLADA2GLTF-bin.exe -i .\%fileName%.dae -o .\convert\%fileName%\%fileName%.gltf

set result=%ERRORLEVEL%

if %result%==0 (
    @echo ********************* Step 2 of 2 [GLTF--XKT] *********************
    node .\xeokit-gltf-to-xkt-0.0.61\gltf2xkt.js -s .\convert\%fileName%\%fileName%.gltf -o .\convert\%fileName%\%fileName%.v6.xkt -f 6

    @REM del .\%fileName%.ifc
    @REM del .\convert\%fileName%\%fileName%.dae
    @REM del .\convert\%fileName%\%fileName%.gltf
    @echo success!
    @echo off

    pause;
) else (
    @echo An error occurred. Please try again later!
    echo off

    pause;
)
